/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package UI;

//import static digitester.GateGlobal.size;
import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.Point;

/**
 *
 * @author pwarnimo
 */
public class Led extends GateGlobal {
    public static final String value = "";
    public static final int type = 0;
    public static final int Outputs = 0;
    public static final int Inputs = 1;
    public static final boolean Negated = false;
    
    public boolean toggle = false;
    
    public Led(Point Coords, int ID) {
        super(type, Coords, Outputs, Inputs, Negated, ID);
        this.setGateType(0);
    }
    
    @Override
    public void paintGate(Graphics2D g2) {
        super.paintGate(g2);
        //g2.drawString(value, this.Coords.x + (size / 2), this.Coords.y + (size / 2));
        
        if (toggle) {
            g2.setColor(Color.GREEN);
        }
        else {
            g2.setColor(Color.gray);
        }
        
        g2.fillOval(this.Coords.x + ((size / 2) - 8), this.Coords.y + ((size / 2) - 8), 16, 16);
        g2.setColor(Color.black);
        g2.drawOval(this.Coords.x + ((size / 2) - 8), this.Coords.y + ((size / 2) - 8), 16, 16);
    }
    
    public void toggle() {
        this.toggle = !this.toggle;
    }
}
